package com.lagou.sqlSession;

import com.lagou.pojo.Configuration;
import com.lagou.pojo.MappedStatement;

import java.util.List;

public interface Executor {

    public <E> List<E> query(Configuration configuration, MappedStatement mappedStatement, Object... params) throws Exception;

    /**
     * 插入数据的方法
     *
     * @param mappedStatement
     * @param params
     * @return
     * @throws Exception
     */
    boolean insert(Configuration configuration, MappedStatement mappedStatement, Object params) throws Exception;


    /**
     * 更新记录的方法
     *
     * @param mappedStatement
     * @param params
     * @return
     * @throws Exception
     */
    boolean update(Configuration configuration, MappedStatement mappedStatement, Object params) throws Exception;


    /**
     * 删除数据的方法
     *
     * @param mappedStatement
     * @param params
     * @return
     * @throws Exception
     */
    boolean delete(Configuration configuration, MappedStatement mappedStatement, Object params) throws Exception;

}
